package com.zzuli.fitness.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzuli.fitness.entity.User;
import com.zzuli.fitness.mapper.UserDao;
import com.zzuli.fitness.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Override
    public User selectUserByOpenId(String openid) {
        return userDao.selectUserByOpenId(openid);
    }

    @Override
    public int addNewUser(User aUser) {
        return userDao.insert(aUser);
    }

    @Override
    public int updateUserInfo(User user) {
        return userDao.updateByPrimaryKey(user);
    }
}
